package com.hsmw.api.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hsmw.api.mapper.HsmwHtnUserMapper;
import com.hsmw.api.mapper.HsmwSaleUserMapper;
import com.hsmw.common.base.BaseService;
import com.hsmw.domain.HsmwHtnUser;
import com.hsmw.domain.HsmwSaleUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class HsmwSaleUserService extends BaseService<HsmwSaleUserMapper, HsmwSaleUser> {


    @Autowired
    private HsmwSaleUserMapper hsmwSaleUserMapper;


    public HsmwSaleUser findByUsername(String username) {
        QueryWrapper<HsmwSaleUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(HsmwSaleUser::getUsername, username);
        return hsmwSaleUserMapper.selectOne(queryWrapper);
    }
}
